<template>
  <div>
<!--    <el-input-->
<!--        placeholder="输入关键字进行过滤"-->
<!--        v-model="filterText">-->
<!--    </el-input>-->
    <el-tree
        :data="data"
        show-checkbox
        node-key="id"
        :default-expanded-keys="[2, 3]"
        :default-checked-keys="[5]"
        :props="defaultProps"
    />
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      data: {},
      defaultProps: {
        children: 'son',
        label: 'name',
      },
    }
  },
  methods: {
    get_dept() {
      axios({url: 'http://127.0.0.1:5000/dept', method: 'get'}).then(res => {
        console.log(res.data.list)
        this.data = res.data.list
      })
    },
  },
  mounted() {
    this.get_dept()
  }
}
</script>
